
import immutable from "immutable"
const defaultState = immutable.fromJS({
    mv:[],
    test:"Are you oK?",
    city:"BIG 武汉",
    num:2000,
    flag:true
})
export const data = (state=defaultState,action)=>{
    const {type,payload} = action 
    switch(type){
        case "changeCity":
            return state.set('city',payload)
            break;
        case "changeDataTestAsync":
            return state.update('test',x=>payload)
            
            break;
        case "getMvList":
            return state.set('mv',payload)
            break;

            case "changeNum":
                return state.update('num',x=>x+payload)
                break;

                case "deleteFlag":
                    return state.delete('flag')
                    break;
            
        default:
            return state;
            break;
    }
}